<?php
global $id,$page,$pagesize;

$id = isset($_REQUEST['id']) ? trim($_REQUEST['id']): '';
$table = 'changjing';
$pagesize = 20;
$changjing = new Changjing();
switch ($act){
	case 'manage' :
		$mng = $changjing->manage();
		break;
		
		
	case 'add' :
		if ($submit){
			$data = $_POST['data'];
			$sql = "SELECT * FROM $changjing->table WHERE TITLE = '$data[title]'";
			$_changjing = $changjing->db->select($sql);
			if ($_changjing){
				showmessage('场景已经存在！','');
			}
			$changjing->db->insert($changjing->table, $data);
			showmessage('添加成功！','?mod=changjing');
		}else{
			$add = Array("title" =>'' ,"changjing" =>'' ,"juese1" =>'' ,"juese2" =>'' ,"juese3" =>'' ,"juese4" =>'',"uid" => 3031283052 , "ispass"=>1);
			break;
		}
		
		
	case 'edit' :
		if ($submit){
			$data = $_POST['data'];
			$changjing->db->update($changjing->table, $data);
			showmessage('修改成功！','?mod=changjing');
		}else{
			$edit = $changjing->edit();
			break;
		}
		
		
	case 'del' :
		$del = $changjing->del();
		showmessage('删除成功！','?mod=changjing');
		break;
}

include admintpl($mod.'.'.$act);
?>